@echo off

set BIN_PATH=%CD%\bin
set SRC_PATH=%CD%\src
set LIB_PATH=%CD%\lib

for /f %%R in ('dir /b %SRC_PATH%') do call :compile %%R
rem goto :eof
pause

:compile
	set file=%1
	if not exist %BIN_PATH% mkdir %BIN_PATH%
	if %file:~-2,2%==js (java -jar %LIB_PATH%/compiler.jar --js %SRC_PATH%/%file% --js_output_file %BIN_PATH%/%file%)
	if %file:~-4,4%==html (copy /y %SRC_PATH%\%file% %BIN_PATH%\)
	if %file:~-9,9%==roperties (copy /y %SRC_PATH%\%file% %BIN_PATH%\)